<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddRecipesExtraFields extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::table('recipes', function(Blueprint $table)
		{
			$table->integer( 'cooking_time' )->nullable( true )->after( 'name' );
			$table->integer( 'preparation_time' )->nullable( true )->after( 'name' );
			$table->integer( 'calories' )->nullable( true )->after( 'name' );
			$table->integer( 'number_persons' )->nullable( true )->after( 'name' );
			$table->enum( 'difficulty', array( 'VE', 'E', 'M', 'H', 'VH' ) )->after( 'name' );
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::table('recipes', function(Blueprint $table)
		{
			$table->dropColumn( 'difficulty' );
			$table->dropColumn( 'preparation_time' );
			$table->dropColumn( 'cooking_time' );
			$table->dropColumn( 'number_persons' );
			$table->dropColumn( 'calories' );
		});
	}

}
